import java.io.*;
import java.util.Arrays;
import java.util.Scanner;


public class Rcc2013Q1_A {
	//static InputStream in = System.in;
	static InputStream in;
	static BufferedWriter out;
	static Scanner scanner;
	
	static {
		try {
			in = System.in;
			//in = new FileInputStream("rcc/2013/input.txt");
			scanner = new Scanner(in);
			out = new BufferedWriter(new OutputStreamWriter(System.out));
			//out = new BufferedWriter(new FileWriter("rcc/2013/output.txt"));
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	static class Rect implements Comparable<Rect>{
		int w;
		int h;
		
		public Rect(int ww, int hh) {
			if (ww > hh) {
				w = ww;
				h = hh;
			} else {
				w = hh;
				h = ww;
			}
		}

		@Override
		public int compareTo(Rect o) {			
			if (this.w > o.w) return -1;
			else if (this.w < o.w) return 1;
			else return -(this.h - o.h);
		}
	}
	
	public static void main(String[] args) throws Exception {
		
		while (true) {
			int w, h;
			Rect[] r = new Rect[3];
			w = scanner.nextInt();
			h = scanner.nextInt();
			if (w == 0) break;
			
			r[0] = new Rect(w, h);
			w = scanner.nextInt();
			h = scanner.nextInt();
			r[1] = new Rect(w, h);
			w = scanner.nextInt();
			h = scanner.nextInt();
			r[2] = new Rect(w, h);
			Arrays.sort(r);
			
			int s = r[0].w*r[0].h;
			if (r[1].h > r[0].h) {
				s += (r[1].h-r[0].h)*r[1].w;
				if (r[2].h > r[1].h) {
					s += (r[2].h - r[1].h)*r[2].w;
				}
			} else {
				if (r[2].h > r[0].h) {
					s += (r[2].h - r[0].h)*r[2].w;
				}
			}
			out.write(s+"\n");
		}
		out.close();
	}
}
